<?php

defined('_JEXEC') or die('Restricted access');

/**

	Version without interface
	
	Attributes:
 	- headerLevel
 	
**/

function modChrome_gavickpro($module, &$params, &$attribs)
{ $badge = preg_match ('/badge/', $params->get('moduleclass_sfx'))?"<span class=\"badge\">&nbsp;</span>\n":"";
	$headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3;
	
	if (!empty ($module->content)) : ?>
		<div class="moduletable<?php echo $params->get('moduleclass_sfx'); ?><?php echo $attribs['additional_class']; ?>">
			<div>
				<div>
					<?php if ($module->showtitle) : ?>
						<?php
							
							$part_one = explode(' ', $module->title);
							$part_one = $part_one[0];
							if(count(explode(' ', $module->title)) > 1)
							{
								$part_two = substr($module->title, strpos($module->title,' '));
							}
							else
							{
								$part_two = '';
							}
							
						?>
					
						<h<?php echo $headerLevel; ?>><span><span class="first-word"><?php echo $part_one; ?></span><?php echo $part_two; ?></span><?php echo $badge; ?></h<?php echo $headerLevel; ?>>
					<?php endif; ?>
		   			<div class="moduletable_content">
						<?php echo $module->content; ?>
					</div>
				</div>
			</div>
		</div>
	<?php endif;
}

?>